/**
 * Company : Siangklom.
 * Created By : Chatree Siangklom
 * Created On : Aug 26, 2013  3:22:10 PM 
 * e-Mail : dr_chatree@hotmail.com
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : com.tis.database.services
 * File Name : SdCustomerOutb1DaoService.java
 * TODO
 */
package com.tis.database.services.staging;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import org.hibernate.HibernateException;

import sap.business.enumeration.STAGING_STATUS;

import com.tis.database.entitys.SapMessage;
import com.tis.database.entitys.staging.SdCustomerOutb1;
import com.tis.database.entitys.staging.StampObject;

/**
 * @author Administrator
 *
 */
public interface ISdCustomerOutb1Services {
	
	/**
	 * 
	 * Date =Oct 3, 2013 : 6:44:39 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 * @param code
	 * @return
	 * @throws HibernateException
	 * @throws Exception
	 */
	List<SdCustomerOutb1> findByCustomerCode(String code) throws HibernateException, Exception;	
	
	/**
	 * 
	 * Date =Oct 3, 2013 : 6:44:34 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 * @param sdCustomerOutb1List
	 * @return
	 * @throws HibernateException
	 * @throws Exception
	 */
	List<SdCustomerOutb1> RefreshObject(List<SdCustomerOutb1> sdCustomerOutb1List) throws HibernateException, Exception;
	
	/**
	 * 
	 * Date =Oct 3, 2013 : 6:44:32 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 * @return
	 * @throws HibernateException
	 * @throws Exception
	 */
	List<SdCustomerOutb1> findAllList() throws HibernateException, Exception;
	
	/**
	 * 
	 * Date =Oct 3, 2013 : 6:44:18 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 * @param e
	 * @throws HibernateException
	 */
	void saveOrUpdate(List<SdCustomerOutb1> e) throws HibernateException;

	/**
	 * 
	 * Date =Oct 3, 2013 : 6:44:20 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 * @param e
	 * @throws HibernateException
	 */
	void saveOrUpdate(SdCustomerOutb1 e) throws HibernateException;

	/**
	 * 
	 * Date =Oct 3, 2013 : 6:44:23 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 * @param e
	 * @throws HibernateException
	 */
	void delete(List<SdCustomerOutb1> e) throws HibernateException;
	
	/**
	 * 
	 * Date =Oct 3, 2013 : 6:44:25 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 * @param e
	 * @throws HibernateException
	 */
	void delete(SdCustomerOutb1 e) throws HibernateException;
	
	/**
	 * 
	 * Date =Oct 3, 2013 : 6:44:28 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 * @param stagingId
	 * @param customer
	 * @param idNo
	 * @param taxId
	 * @param instanceNo
	 * @param syncCreatedOnStart
	 * @param syncCreatedOnEnd
	 * @param maxResult
	 * @return
	 * @throws HibernateException
	 * @throws Exception
	 */
	public List<SdCustomerOutb1> Search(	String stagingId,
											String customer, 
											String name,
											String idNo,
											String taxId, 
											String instanceNo,
											String syncCreatedOnStart,
											String syncCreatedOnEnd,
											int maxResult) throws HibernateException, Exception;
	
	BigDecimal NextSequence() throws HibernateException, Exception;
	
	List<SdCustomerOutb1> findByName(String name) throws Exception, HibernateException;
	
	java.util.Date getCurrentDatabaseDate() throws HibernateException, Exception;
	
	void StampUsedTime(StampObject stampObject, SdCustomerOutb1 e) throws Exception;
	
    void StampUsedTimePROC(String instanceNo, Date procStartTime, Date procEndTime, SdCustomerOutb1 e) throws Exception;
    
    void StampUsedTimeSend(String instanceNo, Date sendUseStart, Date sendUseEnd, SdCustomerOutb1 e) throws Exception;
    
    void StampUsedTimePms(String instanceNo, Date pmsUseStart, Date pmsUseEnd, SdCustomerOutb1 e) throws Exception;
    
    List<SdCustomerOutb1> findByInstanceNo(String instanceNo, SdCustomerOutb1 e) throws HibernateException, Exception;
    
    List<String> NameSplitToSAP(String name) throws Exception, HibernateException;
    
    List<SdCustomerOutb1> UpdateBackSapMessage(List<SapMessage> sapMessages) throws HibernateException, Exception;
    
    void SaveErrorToStaging(String instanceNo, STAGING_STATUS Staging_STATUS, String error);
}
